package de.ralbus.stellplatz;

import com.actionbarsherlock.app.SherlockPreferenceActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.widget.Toast;

public class Voreinstellungen extends SherlockPreferenceActivity {

	void showToast(CharSequence msg) {
        Toast.makeText(this, msg, Toast.LENGTH_LONG).show();     //Einfach einen Toast erstellen
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);		
		addPreferencesFromResource(R.xml.einstellungen);
	
//-------------------------------------Verrsions----------------------------------------------------
		
		Preference versionsPref = (Preference) findPreference("online_hilfe");
        versionsPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        						//hier bei jeder neuen ausgelieferten
                                public boolean onPreferenceClick(Preference preference) {
                                	Uri myUrl = Uri.parse("http://stellplatzfinder.de.vu"); 
                            		Intent update1 = new Intent(Intent.ACTION_VIEW, myUrl);
                                  	startActivity(update1);	
                                        return true;

                                }
                        });
        Preference spendenPref = (Preference) findPreference("spenden");
        spendenPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        						//hier bei jeder neuen ausgelieferten
                                public boolean onPreferenceClick(Preference preference) {
                                	Uri myUrl = Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J4TET5FP86LM6"); 
                            		Intent update1 = new Intent(Intent.ACTION_VIEW, myUrl);
                                  	startActivity(update1);	
                                        return true;

                                }
                        });
	
	}

}
